1 <table height="28" cellSpacing="0" cellPadding="0" width="100%" border="0">
2       <tr align=center>
3         <td
class="title" width="100%" height="17">
4         S&#
7843;n ph&#7849;n bán ch&#7841;y : </td>
5       </tr>
6     </table>
7 <?
8     
switch ($_GET['action'])
9     {
10         
case 'del' :
11             $id = $_GET[
'id'];
12             $sql =
"delete from pro_saleoff where pro_id='".$id."'";
13             @$result = mysql_query($sql,$con);
14             
if ($result) echo "<p align=center class='err'>&#272;ã xóa thành công</p>";
15             
else echo "<p align=center class='err'>Không th&#7875; xóa d&#7919; li&#7879;u</p>";
16             
break;
17     }
18 ?>
19
20 <?
21     
if (isset($_POST['ButDel'])) {
22         $cnt=
0;
23         
foreach ($_POST['chk'] as $id)
24         {
25             @$result = mysql_query(
"delete from pro_saleoff where pro_id='".$id."'",$con);
26             
if ($result) $cnt++;
27         }
28         echo
"<p align=center class='err'>&#272;ã xóa ".$cnt." ph&#7847;n t&#7917;</p>";
29     }
30 ?>
31 <?
32     $page = $_GET[
"page"];
33     $p=
0;
34     
if ($page!='') $p=$page;
35 ?>
36 <form method=
"POST" action="<? echo $_SERVER[PHP_SELF]; ?>" name="frmList">
37 <input type=hidden name=
"page" value="<? echo $page; ?>">
38 <?
39 function taotrang($sql,$link,$nitem,$itemcurrent)
40 {
global $con;
41     $ret=
"";
42     $result = mysql_query($sql, $con) or die(
'Error' . mysql_error());
43     $
value = mysql_fetch_array($result);
44     $plus = (($
value['cnt'] % $nitem)>0);
45     
for ($i=0;$i<($value[0] / $nitem) + plus;$i++)
46     {
47         
if ($i<>$itemcurrent) $ret .= "<a href=\"".$link.$i."\" class=\"lslink\">".($i+1)."</a> ";
48         
else $ret .= ($i+1)." ";
49     }
50     
return $ret;
51 }
52     $pageindex=taotrang(
"select count(*) from pro_saleoff ","./?act=pro_saleoff&cat=".$_REQUEST['cat']."&page=",$MAXPAGE,$page);
53 ?>
54
55 <table cellspacing=
"0" cellpadding="0" width="100%">
56 <?
if ($_REQUEST['code']==1) echo '<tr><td colspan="2" align="center" class="err">&#272;ã c&#7853;p nh&#7853;t thành công</td></tr>'; ?>
57 <tr>
58 <td
class="smallfont">Trang : <? echo $pageindex; ?></td>
59 </tr>
60 </table>
61
62 <table border=
"1" cellpadding="2" style="border-collapse: collapse" bordercolor="#C9C9C9" width="100%" id="AutoNumber1">
63   <tr>
64     <td align=center nowrap
class="title"><input type="checkbox" name="chkall" onclick="chkallClick(this);"></td>
65     <td nowrap
class="title">&nbsp;</td>
66     <td nowrap
class="title">&nbsp;</td>
67     <td align=
"center" nowrap class="title"><b>Mã </b></td>
68     <td align=
"center" nowrap class="title"><b>Tên s&#7843;n ph&#7849;m</b></td>
69     <td align=
"center" nowrap class="title"><b>Th&#7913; t&#7921; s&#7855;p x&#7871;p</b></td>
70     <td align=
"center" nowrap class="title"><b>Không hi&#7875;n th&#7883;</b></td>
71     <td align=
"center" nowrap class="title"><b>Ngày</b></td>
72     <td align=
"center" nowrap class="title"><b>Ngôn ng&#7919;</b></td>
73
74   </tr>
75   
76   <?
77                 $sql=
"select *,DATE_FORMAT(pro_dateadded,'%d/%m/%Y %h:%m') as dateformat from pro_saleoff order by pro_id limit ".($p*$MAXPAGE).",".$MAXPAGE;
78                 $result=mysql_query($sql,$con);
79                 $i=
0;
80                 
while(($row=mysql_fetch_array($result)))
81                 {
82                     $i++;
83                     
if ($i%2) $color="#d5d5d5"; else $color="#e5e5e5";
84                     $proinfo=GetProductInfo($row[
'products_id']);
85   ?>
86   
87   <tr>
88     <td width=
"20" align="center" bgcolor="<? echo $color; ?>" class="smallfont">
89     <input type=
"checkbox" name="chk[]" value="<? echo $row['pro_id']; ?>"></td>
90     <td width=
"20" bgcolor="<? echo $color; ?>" class="smallfont">
91     <a href=
"./?act=pro_saleoff_m&id=<? echo $row['pro_id']; ?>&page=<? echo $page?>">S&#7917;a</a></td>
92     </td>
93     <td width=
"20" bgcolor="<? echo $color; ?>" class="smallfont">
94     <a onclick=
"return confirm('B&#7841;n có ch&#7855;c ch&#7855;n mu&#7889;n xoá ?');" href="./?act=pro_saleoff&action=del&page=<? echo $_REQUEST['page']; ?>&id=<? echo $row['pro_id']; ?>">Xoá</a></td>
95     <td width=
"20" bgcolor="<? echo $color; ?>" align="left" width="55" align="left" class="smallfont"><? echo $row['products_id']; ?>&nbsp;</td>
96     <td bgcolor=
"<? echo $color; ?>" class="smallfont"><? echo $proinfo['products_name']; ?>&nbsp;</td>
97     <td width=
"80" bgcolor="<? echo $color; ?>" class="smallfont"><? echo $row['pro_sortorder']; ?>&nbsp;</td>
98     <td width=
"80" bgcolor="<? echo $color; ?>" class="smallfont"><? echo $row['pro_status']; ?>&nbsp;</td>
99     <td width=
"100" bgcolor="<? echo $color; ?>" class="smallfont"><? echo $row['dateformat']; ?>&nbsp;</td>
100     <td width=
"100" bgcolor="<? echo $color; ?>" class="smallfont"><? echo $row['language']; ?>&nbsp;</td>
101
102   </tr>
103   <?
104                 }
105   ?>
106 </table>
107 <input type=
"submit" value="Xóa Ch&#7885;n" name="ButDel" onclick="return confirm('B&#7841;n có ch&#7855;c ch&#7855;n mu&#7889;n xoá ?');" class="button" style="padding: 0">
108 <input type=
"hidden" name="act" value="pro_saleoff">
109 </form>
110 <script language=
"JavaScript">
111 function chkallClick(o) {
112     
var form = document.frmList;
113     
for (var i = 0; i < form.elements.length; i++) {
114         
if (form.elements[i].type == "checkbox" && form.elements[i].name!="chkall") {
115             form.elements[i].
checked = document.frmList.chkall.checked;
116         }
117     }
118 }
119 </script>



Full source code website bán hàng thương mại điện tử gần giống shopee 468.969 lượt xem

Gõ tìm kiếm nhanh...